package com.healthcloud.utils;

import java.util.Date;

import org.joda.time.DateTime;

import com.healthcloud.entity.BaseEntity;

/**
 * Created by xiam on 2015/6/3.
 */
public abstract class EntityUtils {

	/**
	 * 设置日期
	 *
	 * @param entity
	 */
	public static final void initDateTime(BaseEntity entity) {
		setDateTime(new Date(), entity);
	}

	/**
	 * 设置日期
	 *
	 * @param dateTime
	 * @param entity
	 */
	public static final void setDateTime(Date dateTime, BaseEntity entity) {
		entity.setCreatedTime(dateTime);
		entity.setUpdatedTime(dateTime);
	}
}
